#ifndef LINECHART_H
#define LINECHART_H
#include <QChart>
#include <QChartView>
#include <QLineSeries>
#include <QValueAxis>
#include <QList>
#include <QPen>
QT_CHARTS_USE_NAMESPACE

class LineChart
{
public:

    LineChart();

    //Set the range of X and Y axis
    void SetAxis(int Xmin,int Xmax,int Ymin,int Ymax);

    //Set the title of chart
    void SetChartTitleText(QString title);

    //Set the lengend of chart
    void SetChartLegend();

    //Config the n-LineSeries
    void ConfigLine1Series(QString name);

    //Zoom in on the X-axis of chart
    void ZoomInChart(float OriginalAxisX,float Multiple);

    //Zoom out on the X-axis chart
    void ZoomOutChart(float OriginalAxisX,float Multiple);

    //Restore the maximum value of the x-axis
    void ResetZoomChart(float OriginalAxisXMax);

    //Clear the chart
    void ClearChart();

    //set the maximum value of the Y axis
    void SetAxisYMax(float AxisYMax);

     //set the minimum value of the Y axis
    void SetAxisYMin(float AxisYMin);

    //Restore the maximum and minimum value of the y-axis
    void ResetAxisY(float OriginalAxisYmin,float OriginalAxisYmax);

    //set the maximum of the x-axis
    void SetAxisXmax(float AxisXMax);

    void DrawLine1(QPointF point);

public:
    QLineSeries *Line1;
    QChartView *chartview;
    QChart *chart;
    QValueAxis *axisX;
    QValueAxis *axisY;
    QPen pen1;
};

#endif // LINECHART_H
